function checkCashRegister(price, cash, cid) {
    let money = {
        PENNY: 0.01,
        NICKEL: 0.05,
        DIME: 0.1,
        QUARTER: 0.25,
        ONE: 1,
        FIVE: 5,
        TEN: 10,
        TWENTY: 20,
        ONE_HUNDRED: 100
    };
    let change = cash - price;
    let drawer = parseFloat(
        cid.reduce((acc, cur) => acc + cur[1], 0).toFixed(2)
    );
    if (change > drawer) {
        return { status: "INSUFFICIENT_FUNDS", change: [] };
    } else if (change === drawer) {
        return { status: "CLOSED", change: cid };
    } else {
        let cashArr = [];
        cid.reverse().map(val => {
            let unit = money[val[0]];
            let cache = Math.floor(change / unit);
            if (cache > 0) {
                if (cache * unit >= val[1]) {
                    cashArr.push(val);
                    change = (change - val[1]).toFixed(2);
                } else {
                    cashArr.push([val[0], cache * unit]);
                    change = (change - cache * unit).toFixed(2);
                }
            }
        });

        if (eval(change) === 0) {
            return { status: "OPEN", change: cashArr };
        } else {
            return { status: "INSUFFICIENT_FUNDS", change: [] };
        }
    }
}

// Example cash-in-drawer array:
// [["PENNY", 1.01],
// ["NICKEL", 2.05],
// ["DIME", 3.1],
// ["QUARTER", 4.25],
// ["ONE", 90],
// ["FIVE", 55],
// ["TEN", 20],
// ["TWENTY", 60],
// ["ONE HUNDRED", 100]]

checkCashRegister(19.5, 20, [
    ["PENNY", 1.01],
    ["NICKEL", 2.05],
    ["DIME", 3.1],
    ["QUARTER", 4.25],
    ["ONE", 90],
    ["FIVE", 55],
    ["TEN", 20],
    ["TWENTY", 60],
    ["ONE HUNDRED", 100]
]);
